Ubuntu 10.04
Sponsored Link

Log analyzer - AWstats
2010/07/24
  Install AWstats that is Apache Log analyzer

[1] Install AWstats
root@www05:~#
aptitude -y install awstats


root@www05:~#
vi /etc/awstats/awstats.conf


# line 122: change

# if your config for log format in httpd.conf is 'combined' Set here '1'

# If log-config is 'common' set here '4', but in this case, some informations can't be get (browser info and so on)

LogFormat=
1


# line 153, set your hostname

SiteDomain="
www05.srv.world
"

# line 168: set IP address you'd like to exclude

HostAliases="localhost 127.0.0.1
REGEX[server\.world$] REGEX[^10\.0\.0\.]
"

# line 223: change

DirIcons="
./icon
"

# line 905: change to your language

Lang="
jp
"

root@www05:~#
mkdir /var/www/awstats

root@www05:~#
ln -s /usr/share/awstats/icon /var/www/awstats/icon

root@www05:~#
vi /etc/apache2/sites-available/default


<Directory "/usr/lib/cgi-bin">

AllowOverride None

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Order allow,deny

Allow from
10.0.0.0/24
# IP address you allow

</Directory>


# add these lines

<Location /awstats>

Order deny,allow

Deny from all

Allow from 10.0.0.0/24
# IP address you allow

</Location>

</VirtualHost>

root@www05:~#
/etc/init.d/apache2 restart

  * Restarting web server apache2
  ... waiting ...done.

# generate reports

root@www05:~#
/usr/lib/cgi-bin/awstats.pl -config=apache -update

Create/Update database for config "/etc/awstats/awstats.conf" by AWStats version 6.9 (build 1.925)
From data in log file "/var/log/apache2/access.log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 1199)
Jumped lines in file: 1199
Found 1199 already parsed records.
Parsed lines in file: 93
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 93 new qualified records.

# generate HTML reports from reports above

root@www05:~#
/usr/lib/cgi-bin/awstats.pl -config=apache -output -staticlink > /var/www/awstats/index.html

[2] Access to 'http://(your server's name or IP address/)/awstats/', then follwing sacreen is shown and it's possible to see Apache's logs.
 
 
Tweet